package com.myapp.struts.action;

import com.myapp.hibernate.util.BoxeadorUtil;
import com.myapp.hibernate.util.EstadioUtil;
import com.myapp.struts.form.CombatesForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class NuevoCombateAction extends org.apache.struts.action.Action {

    private static final String SUCCESS = "success";

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        
        CombatesForm formulario = (CombatesForm) form;
        BoxeadorUtil boxeadorUtil= new BoxeadorUtil();
        EstadioUtil estadioUtil = new EstadioUtil();
        
        formulario.setBoxeadores(boxeadorUtil.obtenerListaBoxeadores());
        formulario.setEstadios(estadioUtil.obtenerListaEstadios());
        
        return mapping.findForward(SUCCESS);
    }
}
